<template>
	<view class="container">
		<text>这是详情页 (非 tabBar 页面)</text>
		<text class="route-info">当前路由: {{currentRoute}}</text>
		<text class="param-info">接收到的参数: {{options}}</text>
		<button type="primary" @click="goBack">返回上一页 (navigateBack)</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				currentRoute: '',
				options: null
			}
		},
		onLoad(options) {
			// 知识点：this.route 可以直接获取当前页面的路由
			this.currentRoute = this.route;
			this.options = JSON.stringify(options);
			console.log("详情页 onLoad, 接收参数:", options);
		},
		methods: {
			goBack() {
				uni.navigateBack();
			}
		}
	}
</script>

<style scoped>
	/* scoped 表示样式只对本页面生效 */
	.container {
		display: flex;
		flex-direction: column;
		align-items: center;
		padding-top: 100rpx;
	}

	.route-info,
	.param-info {
		color: #8f8f94;
		margin-top: 20rpx;
		font-size: 28rpx;
	}

	button {
		margin-top: 50rpx;
	}
</style>